package cn.lg.soar.common.util.current;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * 基本用户
 * @author luguoxiang
 * 开源项目：https://gitee.com/lgx1992/lg-soar 求star！请给我star！请帮我点个star！
 */
public interface IBaseUser {

        /**
         * 用户id
         * @return
         */
        Long getId();

        /**
         * 用户名(账号)
         * @return
         */
        String getUsername();

        /**
         * 用户类型
         * @return
         */
        Integer getUserType();

        /**
         * 当前所属租户id
         * @return
         */
        Integer getCurrentTenantId();

        static IBaseUser build(Long id, String username, Integer userType, Integer tenantId) {
              return new Impl(id, username, userType, tenantId);
        }

        @AllArgsConstructor
        @Getter
        @Setter
        public static class Impl implements IBaseUser {

                private Long id;

                private String username;

                private Integer userType;

                private Integer currentTenantId;

        }

}
